#include <tinx/syscall.h>
#include <tinx/stdio.h>

int main()
{
    void *addr = mmap(NULL, 0x2000, PROT_WRITE | PROT_EXEC | PROT_READ, MAP_PRIVATE, -1, 0);
    printf("mmap: 0x%p\n", addr);

    char *ptr = addr;
    *ptr = 'f';

    printf("read 0x%p: %c\n", ptr, *ptr);

    void *addr2 = mmap(NULL, 0x2000, PROT_WRITE | PROT_EXEC | PROT_READ, MAP_PRIVATE, -1, 0);

    printf("mmap2: 0x%p\n", addr2);

    munmap(addr2, 0x2000);
    printf("mumap\n");

    addr2 = mmap(NULL, 0x2000, PROT_WRITE | PROT_EXEC | PROT_READ, MAP_PRIVATE, -1, 0);
    printf("mmap3: 0x%p\n", addr2);

    return EOK;
}